//
//  VC_ForgetPasswordSetNew.m
//  yjw-winner
//
//  Created by 隆霁 on 2018/9/20.
//  Copyright © 2018年 Shanghai decade financial information service co., LTD. All rights reserved.
//

#import "VC_ForgetPasswordSetNew.h"
#import "VC_ForgetPasswordSetSucceed.h"

@interface VC_ForgetPasswordSetNew ()
@property (weak, nonatomic) IBOutlet UITextField *passwordTextField;

@property (weak, nonatomic) IBOutlet UIButton *submitButton;
@property (weak, nonatomic) IBOutlet UITextField *makesurePasswordTextField;
@end

@implementation VC_ForgetPasswordSetNew

- (void)viewDidLoad {
    [super viewDidLoad];
    self.submitButton.layer.masksToBounds = YES;
    self.submitButton.layer.cornerRadius = 4.0f;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark --mark EVENT

- (IBAction)submitButtonClick:(UIButton *)sender {
    NSString *password = self.passwordTextField.text;
    NSString *makesurePassword = self.makesurePasswordTextField.text;
    if (password.length >= 8 && password.length <= 16 && [makesurePassword isEqualToString:password]) {
        // 注册
        VC_ForgetPasswordSetSucceed *vc = [[UIStoryboard storyboardWithName:@"LoginStoryBoard" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:NSStringFromClass([VC_ForgetPasswordSetSucceed class])];
        [self.navigationController pushViewController:vc animated:YES];
    }
    if (password.length < 8 || password.length > 16) {
        [MBProgressHUD showSuccess:@"密码格式错误"];
    }
    if (![password isEqualToString:makesurePassword]) {
        [MBProgressHUD showSuccess:@"两次密码不一致"];
    }
}

@end
